<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>卖家-修改个人信息</title>
<link href="<?php echo $this->_webroot('/user/css/common.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->_webroot('/user/css/content1.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->_webroot('/user/js/jquery-1.7.1.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->_webroot('/user/js/common.js'); ?>" type="text/javascript"></script>

<style type="text/css">
.edit span{background:#FFF2E6;}
.search {margin:5px; height:30px; background:#fff; width:90%; padding-left:0px; text-align:left;}
.search input {color:#444;}
td{text-align:left;}
td div.goodsname{line-height:18px;  font-weight:bold;}
td span.category{color:#FF6600;}
</style>
 
</head>
<body>
<psp:tags     htmlname='user_topnav1'  iconname='usertopnav1' />
<psp:tags     htmlname='user_topsearch'  iconname='usertopsearch' />

<div class="main">
	<div class="main-left">
    	<div class="title">会员管理中心</div>
        <psp:tags     htmlname='user_menulist'  iconname='usermenulist' />
    </div>
<link href="<?php echo $this->_webroot('/user/css/shoprequest.css'); ?>" rel="stylesheet" type="text/css" />   
    <div class="main-right main_right">
	

            <div class="cont">            
                <div class="cont_title">
					<span class="tr_op">
					<a href="<?php echo $this->_url('supplier/distribution');?>">切换分销商</a>
					<a href="<?php echo $this->_url('supplier/disgoods/?id='.$supplier_id);?>">返回上一层</a>
					</span>
					分销商[<?php echo $SHOP['shop_name']; ?>]的进货详情
				</div>
				<div class="clear" style="height:5px;"></div>
			<form action="<?php echo $this->_url('supplier/stock/');?>" method="post" onsubmit="return submitform();">
				<table width="100%" class="">
                    <tr class="">
						<th width="40"><input type="checkbox" onclick="checkall(this)" value="" name="c"></th>
						<th width="55">ID号</th>						
						<th>商品信息</th>
						<th width="110" align="left">进货价格</th>					
						<th width="60">进货数量</th>
						<th width="160">进货时间</th>
				   </tr>
					<?php 
					if(!empty($result['data'])) {
						foreach($result['data'] as $v) {  ?>
					<tr class="trcolor">
						<td class="center" width="40">
						    <input type="checkbox" name="checkbox[]" value="<?php echo  $v['id'];?>" />				
						</td>
						<td style="text-align:center;" ><?php echo  $v['id'];?></td>						
						<td align="left" valign="top">
							<div class="goodsname"><a href="<?php echo $this->_url('shop/productshow/'.$v['goods_id']);?>" target="_blank"><?php echo  $v['goods_name'];?></a></div>							
						</td>
						<td align="left" >￥<?php echo  $v['jprice'];?>元&nbsp;</td>
						<td style="text-align:center;" ><?php echo  $v['jnumber'];?></td>
						<td style="text-align:center;" ><?php echo  $v['jadd_time'];?></td>						
					</tr>
					<?php }?>
                    <tr><td class="page" colspan="5">
					<a href="<?php  echo $result['page']['prevPage'] ; ?>" class="upPage">上一页</a>
					<a href="#" class="now"><?php  echo $result['page']['current']['num'] ; ?></a>
					<a href="<?php  echo $result['page']['nextPage'] ; ?>" class="nextPage">下一页</a>
					</td></tr>
					<tr><td colspan="5">
					    <input type="hidden" name="id" value="<?php echo $supid ;?>" />
					</td></tr>
					<?php  } else {?>
					<tr><td colspan="5" class="center">暂无信息</td></tr>
					<?php }?>
				</table>
			</form>
					  		  
            </div>
    </div>
    <div class="clear"></div>
</div>

<div class="footer">
    <psp:tags     htmlname='user_footer_helper'  iconname='userfooterhelper' />

</div>

<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js');?>"></script>
<script language="JavaScript">
<!--
var inputs = document.getElementsByTagName("input");
function submitform() {
	var status = document.getElementsByName("checkbox");
	var checknum = 0;
	for(var i=0; i<inputs.length; i++) {
		if(inputs[i].type=='checkbox') {
			if(inputs[i].checked) {
				checknum++;
			}
		}
	}
	if(checknum==0) {
		alert("致少要选择一项，才能进行操作！");
		return false;
	}
	return true;
}

function checkall(obj) {
	if(obj.checked) {
		for(var i=0; i<inputs.length; i++) {
			if(inputs[i].type=='checkbox') {
				inputs[i].checked = true;
			}
		}
	} else {
		for(var i=0; i<inputs.length; i++) {
			if(inputs[i].type=='checkbox') {
				inputs[i].checked = false;
			}
		}
	}
}

		function addCart(id) {
			var num = document.getElementById('jnum_'+id);
			var jprice = document.getElementById('jprice_'+id);		
			var num_reg = /^(\d+)$/;
			if(!num_reg.test(num.value)){
				alert('进货数量格式不正确!');
				return;
			}
			if(num.value=='0'){
				alert('进货数量不能为0！');
				return;
			}


		    ajax("<?php echo $this->_url('supplier/getstock');?>","POST","id="+id+"&num="+num.value+"&jprice="+jprice.value,function(data){
					if(data == 1) {
						alert("已成功添加到您的进货篮中！");
					} else if(data == -1) {
						alert("此商品已在您的进货篮中！");
					} else {
						alert("添加失败，请确认您是否已登陆！");
					}
			});
		}
//-->
</script>
</body>
</html>